package com.yuexun.beilunpatient.ui.main.model.impl;

import com.yuexun.beilunpatient.base.BaseEntity;
import com.yuexun.beilunpatient.ui.main.api.AreaHospApi;
import com.yuexun.beilunpatient.ui.main.bean.AreaBean;
import com.yuexun.beilunpatient.ui.main.model.IAreaHospModel;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by chenss on 2017/12/14 0014.
 */

public class AreaHospModel implements IAreaHospModel {

    private AreaHospApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public AreaHospApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(AreaHospApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<AreaBean>> inquireAreaWithHospList(Map<String, String> praise) {
        api = ApiInstance();
        return api.inquireAreaWithHospList(praise);
    }
}
